package pl.cezary.butler.walili.common;

import java.io.Serializable;


// <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
// #[regen=yes,id=DCE.D7AF79D5-4AE3-56E5-0F7D-6ED7A21C22A1]
// </editor-fold> 

public class Query implements Serializable {

    static final long serialVersionUID = 5812990211483883654L;
    private String location;
    private String target;
    private TaskStatus status;
    private int limit;

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.27002DE3-9F9B-7797-070B-BEF62E29E0AE]
    // </editor-fold> 
    protected Query() {
        limit=-1;
    }

    //<editor-fold defautstate="collapsed" desc=" CZĘŚĆ NARZĘDZIOWA ">
    private String setNonNull(String in) {
        return (in == null) ? "" : in;
    }
    public Query(String cel, String polozenie, TaskStatus status) {
        this(cel,polozenie,status,-1);
    }
    
    public Query(String cel, String polozenie, TaskStatus status, int limit) {
        this.limit = limit;
        setLocation(polozenie);
        setTarget(cel);
        this.status = status;
        
    }

    public String getTarget() {
        return target;
    }

    public final void setTarget(String cel) {
        this.target = setNonNull(cel);
    }

    public String getLocation() {
        return location;
    }

    public final void setLocation(String polozenie) {
        this.location = setNonNull(polozenie);
    }

    public TaskStatus getStatus() {
        return status;
    }

    public final void setStatus(TaskStatus status) {
        this.status = status;
    }

    public int getLimit() {
        return limit;
    }

    public void setLimit(int limit) {
        this.limit = limit;
    }    
    
}

